<%@page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<link href="<%=syscontextPath %>/images/skin.css" rel="stylesheet" type="text/css" />
<link href="<%=syscontextPath %>/images/fox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=syscontextPath %>/js/jquery/jquery-1.3.2.min.js "></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="<%=syscontextPath %>/images/mail_leftbg.gif"><img src="<%=syscontextPath %>/images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="<%=syscontextPath %>/images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">企业信息</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=syscontextPath %>/images/mail_rightbg.gif"><img src="<%=syscontextPath %>/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="<%=syscontextPath %>/images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top">
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
            <form name="form1" method="post" id="form1" action="<%=syscontextPath %>/basicinfo/cudcompany/1">
            	<c:choose>
					<c:when test="${company ==null}">
						<input type="hidden" name="id"  id=="id" value="0">
					</c:when>
					<c:otherwise>
						<input type="hidden" name="id"  id=="id" value="${company.id}">
					</c:otherwise>
				</c:choose> 
                <table width="100%" height="90" border="0" cellpadding="0" cellspacing="0">
                  <tr bgcolor="#f2f2f2">
                    <td width="27%" align="right"  class="left_txt">企业编号：</td>
                    <td width="27%"  class="left_txt"><input type="text" name="companynumber" id="companynumber" size="30" value="${company.companynumber}"></td>
                  </tr>
                  
                  <tr>
                    <td align="right"  class="left_txt">企业名称：</td>
                    <td class="left_txt"><input type="text" style="color=red" name="name" id="name" value="${company.name}" size="40" class="button01" /></td>
                    </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt">企业地址：</td>
                    <td class="left_txt"><input type="text" style="color=red" name="address" id="address" value="${company.address}" size="40" class="button01" /></td>
                    </tr>
                     <tr>
                    <td width="27%" align="right" class="left_txt">企业电话：</td>
                    <td width="27%"  class="left_txt"><input type="text" style="color=red" name="telephone" id="telephone" value="${company.telephone}" size="30" class="button01" /></td>
                  </tr>
                   <tr bgcolor="#f2f2f2">
                    <td width="27%" align="right" bgcolor="#f2f2f2" class="left_txt">管理人：</td>
                    <td width="27%" bgcolor="#f2f2f2" class="left_txt"><input type="text" style="color=red" name="manager" id="manager" value="${company.manager}" size="30" class="button01" /></td>
                  </tr>
                    <tr>
                    <td width="27%" align="right"  class="left_txt">管理人电话：</td>
                    <td width="27%" class="left_txt"><input type="text" name="managertel" id="managertel" value="${company.managertel}" size="30" class="button01" /></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td colspan="2" align="center" class="left_txt">
                      <input type="button"  id="saveform" value="确定">&nbsp;&nbsp;
                      <input type="button" name="resetform" id="rsbutton" onclick="close_win();" value="关闭">
                    </td>
                  </tr>
                </table>
                </form>
             </td>
          </tr>
          
        </table>
          </td>
      </tr>
    </table></td>
    <td background="<%=syscontextPath %>/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="<%=syscontextPath %>/images/mail_leftbg.gif"><img src="<%=syscontextPath %>/images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="<%=syscontextPath %>/images/buttom_bgs.gif"><img src="<%=syscontextPath %>/images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="<%=syscontextPath %>/images/mail_rightbg.gif"><img src="<%=syscontextPath %>/images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>
<script type="text/javascript">
<!--
$("#rsbutton").click(function (){
	removeModal();	
});

$("#saveform").click(function (){
	//alert('sss');
	if (checkform()) {
		var content = "";
			//序 列化表格元素 (类似 '.serialize()' 方法) 返回 JSON 数据结构数据
			content = $("#form1").serializeArray();
			//alert(content);
			$.post('<%=syscontextPath %>/basicinfo/cudcompany/1', content, function(data) {
				if (data) {
					alert("保存成功！");
					location = "<%=syscontextPath %>/basicinfo/companylist";
				} else {
					alert("保存失败！");
					location = "<%=syscontextPath %>/basicinfo/companylist";
				}
			},"json");
		//$("#form1").submit();
		}
});

/**
 * 检查form
 */
function checkform() {
	var name = $("#name").val();
	var address = $("#address").val();
	var telephone = $("#telephone").val();
	var manager = $("#manager").val();
	var managertel = $("#managertel").val();
	if (name == "") {
		alert("企业名称不能为空");
		return false;
	}
	if (address == "") {
		alert("企业地址不能为空");
		return false;
	}
	if (telephone == "") {
		alert("企业电话不能为空");
		return false;
	}
	if (manager == "") {
		alert("管理人不能为空");
		return false;
	}
	if (managertel == "") {
		alert("管理人电话不能为空");
		return false;
	}
	return true;
}
//-->
</script>
